<template>
  <div >
     <ListTemp v-for="(item,index) in merchantData" :item="item" :key="index" :index="index" />
  </div>
</template>

<script>
  // Use Vuex
  // import {mapState} from 'vuex'
  import ListTemp from '../list-template/list-template'
  export default {

    components:{
      ListTemp
    },
    data() {
      return {
        show: true,
        // detatilData: {},
        // shangjia:{},
        // fdex:''
        merchantSortid:'',
        merchantData:'',

      }
    },
    methods: {

    },
    beforeMount() {
      // console.log(this);
      //this.$mp.query.index取代onload 的options
      //更新数据
      // console.log('第二页显示的第一页的索引[0,1,2,3,4,4...]'+':'+this.fdex);
      // console.log('第二页显示的第一页的索引[0,1,2,3,4,4...]'+':'+this.index);
      // this.detatilData = this.listTmp[this.$mp.query.index];
      // this.shangjia=this.detatilData.typeDetail;
      // console.log(this.shangjia)
    },
    computed:{
      // ...mapState(['listTmp'])
    },
    onLoad(options){
      var that=this;
      this.merchantSortid=options.index;
      // console.log(this.merchantSortid);
      wx.request({
        url: 'http://192.168.1.20:8099/WebHandler/GuoUserHandler.ashx',
        method: 'post',
        data: {
          type: 'findMerchant',
          merchantLaber:this.merchantSortid
        },
        header: {
          'content-type': 'application/x-www-form-urlencoded' // 默认值
        },
        success: function (res) {
          that.merchantData=res.data.address;
          // console.log(that.merchantData);


        }
      })

      // console.log(options)
      // this.detatilData = {}
      // this.shangjia = {}
      // this.fdex = ''
      // this.index = this.fdex = e.index;
      // console.log(this.index);

      // console.log(e.index)
    }

    // onUnload: function () {
    //   console.log("page ---onUnload---");
    // }

  }
</script>

<style>
page{
  background-color: #fff;
}
</style>
